@@ -1,8 +1,13 @@  | 
            ||
| 1 | 1 | 
                # -*- coding: utf-8 -*-  | 
            
| 2 | 2 | 
                 | 
            
| 3 | 
                +import logging  | 
            |
| 4 | 
                +  | 
            |
| 3 | 5 | 
                from django.conf import settings  | 
            
| 4 | 6 | 
                 | 
            
| 5 | 7 | 
                 | 
            
| 8 | 
                +logger = logging.getLogger('logit')
               | 
            |
| 9 | 
                +  | 
            |
| 10 | 
                +  | 
            |
| 6 | 11 | 
                def DJANGO_WE_CFG_FUNC(request, state=None):  | 
            
| 7 | 12 | 
                """ WeChat CFG Callback Func """  | 
            
| 8 | 13 | 
                if state in ['component_auth', 'component_callback', 'component_preauth_callback']:  | 
            
                @@ -41,6 +46,10 @@ def DJANGO_WE_COMPONENT_CALLBACK_FUNC(request, appid, data, decrypted=None):  | 
            ||
| 41 | 46 | 
                """ WeChat Component Message Callback Func """  | 
            
| 42 | 47 | 
                from account.models import UserInfo  | 
            
| 43 | 48 | 
                 | 
            
| 49 | 
                + logger.info(appid)  | 
            |
| 50 | 
                + logger.info(data)  | 
            |
| 51 | 
                + logger.info(decrypted)  | 
            |
| 52 | 
                +  | 
            |
| 44 | 53 | 
                     event = decrypted.get('Event', '')
               | 
            
| 45 | 54 | 
                     tousername = decrypted.get('ToUserName', '')
               | 
            
| 46 | 55 | 
                     openid = fromusername = decrypted.get('FromUserName', '')
               |